from .base_model import BaseModel
from .student import Student
from .classinfo import ClassInfo
from django.db import models
from datetime import date

class StudentClassEnrollment(BaseModel):
    """学生班级关系"""
    student = models.ForeignKey(Student, on_delete=models.CASCADE, verbose_name="学生")
    class_id = models.ForeignKey(ClassInfo, on_delete=models.CASCADE, verbose_name="班级")
    enrollment_date = models.DateField(default=date.today, verbose_name="入学日期")
    exit_date = models.DateField(null=True, blank=True, verbose_name="离校日期")
    is_active = models.BooleanField(default=True, verbose_name="是否活跃")
    class Meta:
        db_table = "student_class_enrollment"
        verbose_name = "学生班级关系"
        verbose_name_plural = "学生班级关系"